mini.parse();
var tree=mini.get("tree1");
var form=new mini.Form("form1");
var baseUrl = "http://localhost:8080/DSMP";
// var treedata=[
//     {"name":"1日程模块", "id":"rcmk", expanded: true},
//     {"name":"1.1新建", "id":"xj", "pid": "rcmk"},
//     {"name":"1.2修改","id":"xg", "pid": "rcmk"},
//
//     {"name":"2会议模块", "id":"yw", expanded: true},
//     {"name":"2.1", "id":"sc", "pid": "yw"},
//     {"name":"2.1", "id":"js", "pid": "yw"}
// ];
// tree.loadList(treedata);
//初始化
$(function () {
    $.ajax({
        url:baseUrl+"/catalogue/getCatalogueTree.do",
        type:"post",
        success:function (data) {
            console.log(data);
            tree.setData(data.obj);
        },
        error:function (data) {

        }
    })
});
//树节点选中时发生的事
tree.on("nodeselect",function (e) {
    var selecNode=e.node;
    console.log(selecNode);

    ajaxBack(selecNode);
});
//请求点击节点以后的数据
function ajaxBack(selecNode) {
    var data="vCatalogName="+selecNode.vCatalogName;
    console.log(data);
    if(selecNode){
        $.ajax({
            url:baseUrl+"/moduleDeclaration/find.do",
            type:"post",
            data:data,
            success:function (data) {
                console.log(data);
                form.setData(data);
            },
            error:function (data) {
                consoel.log(data);
            }
        })
    }
}
